import React, { Component } from 'react'

export default class Input extends Component {
    state = {
        ipt: "初始数据"
    }
    changeIpt = (ev) => {
        this.setState({
            ipt: ev.target.value
        })
    }
    render() {
        const { ipt } = this.state
        return (
            <div>
                <input type="text" value = { ipt } onChange = { this.changeIpt } />
                <p>
                    {ipt}
                </p>
                {/* <button onClick = { this.changeIpt }>点我</button> */}
            </div>
        )
    }
}
